#include <iostream>
#include <vector>

using namespace std;

int removeDuplicates(vector<int>& nums)
{
    int index = 0;
    int count = 1;
    for (size_t i = 1; i < nums.size(); i++) {
        if (nums[index] != nums[i]) {
            index++;
            nums[index] = nums[i];
            count = 1;
        } else {
            if (count == 1) {
                index++;
                nums[index] = nums[i];
                count++;
            }
        }
    }
    return index + 1;
}

int main()
{
    vector<int> num = { 0, 0, 1, 1, 1, 1, 2, 3, 3 };
    int count = removeDuplicates(num);
    for (size_t i = 0; i < count; i++) {
        std::cout << num[i]<< ',';
    }
    std::cout << "size" << count;
    return 0;
}
